More than 500,000 people sought opioid use disorder (OUD) treatment from state-certified addiction treatment facilities in 2016, and the most frequently accessed form of treatment was supervised opioid withdrawal (also known as detoxification). There has been surprisingly little empirical investigation into mechanisms underlying individual opioid withdrawal symptoms and corresponding best practices for their management. A recent FDA public meeting that included patients with OUD identified sleep disturbance as a primary contributor to OUD treatment failure. The scientific premise of this phased UG3/UH3 proposal is that suvorexant (SUVO; Belsomra) will improve total sleep time in patients undergoing routine supervised withdrawal from opioids (UG3), and that SUVO will outperform a medication that is commonly administered for that indication (trazodone; UH3). SUVO is a dual orexin receptor antagonist that is FDA-approved for insomnia and is well- suited for this study because it has low abuse potential, improves sleep continuity and architecture with a single dose, has an extremely safe and mild side effect profile, has clear interactions with the opioid system, and has not yet been evaluated in OUD patients. Our interdisciplinary study team includes several experts in OUD and sleep and our proposal provides preliminary evidence of sleep impairment during OUD withdrawal. The UG3 (N=36) and UH3 (N=60) studies will use identical methods and will vary only in the medications examined. OUD patients will be admitted to a residential research unit for 11 days, and will be stabilized on buprenorphine for 3 days before undergoing a 4-day routine taper and a 4-day post-taper period. Study medication will be double-blinded and will begin on Taper day 1. Primary outcomes will be objective sleep measures (unobtrusive EEG via the Sleep ProfilerTM and wrist-worn actigraph) and abuse liability. Secondary measures will include objective, biological, and self-report measures of opioid withdrawal severity, treatment retention, craving, and stress. The UG3 phase will be a dose-finding study of SUVO (10mg, 20mg) compared to placebo. The go-no go decision (i.e. milestone) for UH3 transition will be if either SUVO dose produces a mean increase in total sleep time of at least 10 minutes relative to placebo during the taper. The UH3 phase will be a comparative efficacy trial of trazodone (100mg) vs. the SUVO dose identified in the UG3, to evaluate whether SUVO improves sleep compared to a regularly used sleep aid during opioid withdrawal. After the UH3, results will be collapsed across both studies to examine sleep and withdrawal associations more generally, and men and women will be equally enrolled in both studies to enable sex subgroup comparisons. We hypothesize SUVO will improve total sleep time during withdrawal, will not show evidence of abuse liability, and will be more efficacious than trazodone. Results will advance the treatment of OUD, the understanding of sleep and opioids, and the use of SUVO in clinical populations. These data may also support more prospective evaluations into the use of SUVO as an OUD craving medication.